
import { useI18n } from 'vue-i18n'
import type { IJsonItem } from '../types'

export function useName(from?: number): IJsonItem {
  const { t } = useI18n()

  console.log('useName--')
  return {
    type: 'input',
    field: 'name',
    class: 'input-node-name',
    name: from === 1 ? t('project.node.task_name') : t('project.node.name'),
    props: {
      placeholder: t('project.node.name_tips'),
      maxLength: 100
    },
    validate: {
      trigger: ['input', 'blur'],
      required: true,
      message: t('project.node.name_tips')
    }
  }
}
